package com.tiantian.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tiantian.dao.TaskActionIllustrationRepository;
import com.tiantian.datajpa.service.impl.GenericServiceImpl;
import com.tiantian.domain.Taskactionillustration;
import com.tiantian.service.TaskActionIllustrationService;

@Service
public class TaskActionIllustrationServiceImpl extends GenericServiceImpl<Taskactionillustration, String> implements TaskActionIllustrationService {
	private TaskActionIllustrationRepository repository;

	@Autowired
	public void setRepository(TaskActionIllustrationRepository repository) {
		super.setGenericDAO(repository);
		this.repository = repository;
	}

	/**
	 * 获取任务操作示意图
	 * 
	 * @param tid
	 * @return
	 */
	public List<Taskactionillustration> getByTaskId(String tid) {
		String sql = "select * from TaskActionIllustration t where t.TaskID=:taskId";
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("taskId", tid);
		return repository.queryListBySql(sql, params, Taskactionillustration.class);
	}

}
